<?php $this->load->view("common/header") ?>
<body class="qt">
<div id="page_wrapper">

<?php $this->load->view("common/speel");
  
?>

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="250" align="left" valign="top" id="navContent"><?php $this->load->view("nav/main") ?></td>
      <td  valign="top" id="mainContent"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><span class="welcomeMsg"><?php echo get_SYS_WELCOME() .", ". $_SESSION['user_fullname'] ?></span></td>
        </tr>
        <tr>
          <td><br>
            <table width="100%" border="0" align="left" cellpadding="5" cellspacing="0">
            <tr>
              <td width="52%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
                <tr>
                  <td colspan="4" class="tbl_header">Recently added jobs</td>
                  </tr>
                <tr class="tbl_row_header">
                  <td width="8%">Id</td>
                  <td width="23%">Client</td>
                  <td>Job Subject</td>
                  <td>Added</td>
                  </tr>
                <?php foreach ($jobs_recent as $js) { ?>
                <tr tip="Time: <?php echo $js['job_logged'] ?>" class="tbl_row" onClick="$(redirect('<?php echo base_url(). "job/editjob/".$js['id'] ?>')); ">
                  <td width="8%"><?php echo $js['id'] ?></td>
                  <td width="23%"><?php echo $js['company_name'] ?></td>
                  <td width="51%"><?php echo $js['job_subject'] ?></td>
                  <td width="18%"><?php echo date("d/m/Y", strtotime($js['job_logged'])) ?></td>
                  </tr>
                <?php } ?>
                </table>
                <br>
                <table width="100%" border="0" cellspacing="0" cellpadding="2">
                  <tr>
                    <td colspan="5" class="tbl_header">Recently completed jobs</td>
                    </tr>
                  <tr class="tbl_row_header">
                    <td width="8%">Id</td>
                    <td width="23%">Client</td>
                    <td width="38%">Job Subject</td>
                    <td width="13%">Hours</td>
                    <td width="18%">Completed</td>
                    </tr>
                  <?php foreach ($jobs_completed as $js) { ?>
                  <tr class="tbl_row" onClick="$(redirect('<?php echo base_url(). "job/editjob/".$js['id'] ?>')); ">
                    <td width="8%"><?php echo $js['id'] ?></td>
                    <td width="23%"><?php echo $js['company_name'] ?></td>
                    <td width="38%"><?php echo $js['job_subject'] ?></td>
                    <td width="13%">
                      <?php 
				 	 
				 	 echo rel_time($js['job_end'], $js['job_start']);
				  ?></td>
                    <td width="18%"><?php echo date("d/m/Y", strtotime($js['job_end'])) ?></td>
                    </tr>
                  <?php } ?>
                  </table><br>
  <table width="100%" border="0" cellspacing="0" cellpadding="2">
    <tr>
      <td colspan="4"class="tbl_header">User activity</td>
      </tr>
    <tr class="tbl_row_header">
      <td width="8%">Id</td>
      <td width="40%">User</td>
      <td width="34%">Type</td>
      <td width="18%">Last login</td>
      </tr>
    <?php foreach ($user_act as $js) { ?>
    <tr class="tbl_row" onClick="$(redirect('<?php echo base_url(). "user/edituser/".$js['id'] ?>')); ">
      <td width="8%"><?php echo $js['id'] ?></td>
      <td width="40%"><?php echo $js['firstname']." " . $js['lastname'] ."(".$js['username'].")" ?></td>
      <td width="34%"><?php echo $js['user_type_lbl'] ?></td>
      <td width="18%"><?php echo date("d/m/Y", strtotime($js['lastlogin'])) ?></td>
      </tr>
    <?php } ?>
    </table>
                </td>
              <td width="48%" valign="top">&nbsp;</td>
            </tr>
          </table></td>
        </tr>
      </table></td>
    </tr>
</table>


<?php $this->load->view("common/footer") ?>
</div>

</body>
</html>
